package com.roy.galaxy.algorithm;

/**
 * @author gang.wang1903@xiaobao100.cn
 * @Date: 2019-10-09 09:42
 */
public class Fibonacci {


    public int FibonacciSolution(int n) {
        if(n <= 0) return 0;
        if(n==1 || n==2) return 1;
        return FibonacciSolution(n-1)+FibonacciSolution(n-2);
    }


    public static void main(String[] args) {

       System.out.print( new Fibonacci().FibonacciSolution(2));
    }
}
